$(function(){
		var styleSheets=$('link[ui_role=style_option]');
		var stylesPicker=$('#stylesPicker');
		/**
		 * The style changing mechanism(via the links at the top).
		 */
		styleSheets.each(function(){
				var styleSheet=$(this);
				var styleName=styleSheet.attr('href').split('/');
				styleName=styleName[styleName.length-1].split('.')[0];
				var styleLink=$(renderEjs('widgets/style_picker_link',{name:styleName}));
				if('White'!=styleName){
					styleSheet.prop('disabled',true);
				}else{
					styleLink.addClass('active');
				}
				styleLink.click(function(){
						styleSheets.prop('disabled',true);
						styleSheet.prop('disabled',false);
						stylesPicker.children().removeClass('active');
						styleLink.addClass('active');
				});
				stylesPicker.append(styleLink);
				stylesPicker.append(' ');
		});
});
